package com.nsoft.thickclient.trackMove.gc;

import javax.swing.JTabbedPane;

import com.nsoft.thickclient.controller.ScreenView;
import com.nsoft.thickclient.model.VoModel;
import com.nsoft.thickclient.trackMove.intr.gc.ConsignmentNote;
import com.nsoft.thickclient.utils.IconFactory;

public class GcView extends ScreenView<ConsignmentNote> {

	private VoModel model = new VoModel(ConsignmentNote.class);

	private boolean editMode;

	private GcGeneralView generalView;

	public GcView(ConsignmentNote bean) {
		if (bean != null) {
			editMode = true;
			model.setValueObject(bean);
		}
		JTabbedPane tabbedPane = new JTabbedPane();
		add(tabbedPane);
		generalView = new GcGeneralView(null);
		tabbedPane.addTab("General", IconFactory.getImage(IconFactory.USER),
				generalView);
	}

	@Override
	public ConsignmentNote getWorkingBean() {
		((ConsignmentNote) model.getValueObject()).setGeneral(generalView
				.getWorkingBean());
		return (ConsignmentNote) model.getValueObject();
	}

	@Override
	public void setWorkingBean(ConsignmentNote bean) {
		// TODO Auto-generated method stub

	}

	public VoModel getModel() {
		return model;
	}

}
